package demo2;

import com.sun.xml.internal.ws.api.model.wsdl.WSDLOutput;

public class Test {

    public static void main(String[] args) {
        Object obj = new Person("aaaa");
        Object obj1 = new Person("bbbb");
    }
    public void func(Object object) {

    }

    public static void main2(String[] args) throws CloneNotSupportedException{
        Person person1 = new Person("恭喜");
        Person person2 = (Person) person1.clone();

        System.out.println(person1.m.money);
        System.out.println(person2.m.money);

        System.out.println("=============");

        person2 .m.money = 9.9;

        System.out.println(person1.m.money);
        System.out.println(person2.m.money);
    }


    public static void main1(String[] args) throws CloneNotSupportedException
    {
        Person person1 = new Person("恭喜");
        //Person person2 = person1.clone();     //强转
        Person person2 = (Person) person1.clone();
        System.out.println(person2);
    }
}
